home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b4.d64
/
charcount.l
< prev
next >
Wrap
Text File
|
2007-02-28
|
704b
|
31 lines
0010 DIM TEXT$ OF 80, CHAR$ OF 1
0020 ROW:=0; CONS:=0; DIG:=0; OTH:=0; VOW:=0
0030 READ TEXT$
0040 FOR CH:=1 TO LEN(TEXT$) DO
0050 CHAR$:=TEXT$(CH:CH)
0060 IF CHAR$>="A" AND CHAR$<="Z" THEN
0070 LETTER
0080 ELSE
0090 NONLETTER
0100 ENDIF
0110 ENDFOR CH
0120 PRINT VOW;"VOWELS";CONS;"CONSONANTS"
0130 PRINT DIG;"DIGITS";OTH;"OTHERS"
0140 PROC LETTER
0150 IF CHAR$ IN "AEIOU" THEN
0160 VOW:=VOW+1
0170 ELSE
0180 CONS:=CONS+1
0190 ENDIF
0200 ENDPROC LETTER
0210 PROC NONLETTER
0220 IF CHAR$<>" " THEN
0230 IF CHAR$ IN "0123456789" THEN
0240 DIG:=DIG+1
0250 ELSE
0260 OTH:=OTH+1
0270 ENDIF
0280 ENDIF
0290 ENDPROC NONLETTER
0300 DATA "CRY 'HAVOC', AND LET SLIP THE DOGS OF WAR. - JULIUS CAESAR 3.2"